(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[277],{3962:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile",function(){return n(4558)}])},3684:function(e,t,n){"use strict";var r=n(5893);t.Z=function(e){var t=e.text;return(0,r.jsx)("p",{className:"text-base leading-7",children:t})}},6703:function(e,t,n){"use strict";var r=n(5893);n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){for(var t=1;t0?t:" ",contactId:s.contactId}),headers:{"Content-Type":"application/json"},method:"POST"});case 4:return r=e.sent,e.next=7,r.json();case 7:a=e.sent,l=a.error,S(!1),n(!1),l?g(!0):(v(!0),setTimeout((function(){v(!1)}),2e3)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),console.log(e.t0),g(!0),n(!1);case 19:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(){return e.apply(this,arguments)}}();(0,l.useMemo)((function(){return f()(C,1500)}),[s,u]);return(0,r.jsxs)(r.Fragment,{children:[s&&s.valueSet.valueSetDefinition.value.map((function(e,t){return(0,r.jsxs)("div",{className:"relative flex items-start my-3",children:[(0,r.jsx)("div",{className:"flex items-center h-5",children:(0,r.jsx)("input",{id:"comments","aria-describedby":"comments-description",name:"comments",type:"checkbox",onChange:function(t){if(S(!0),n(!0),t.target.checked){var r=u;r.push(e.fullName),d(r),C()}else{var a=u.filter((function(t){return t!==e.fullName}));d(a),0===a.length?P():C()}},checked:!!u&&u.find((function(t){return t.includes(e.fullName)})),className:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"})}),(0,r.jsx)("div",{className:"ml-3 text-sm",children:(0,r.jsx)("label",{htmlFor:"comments",className:"font-medium text-white",children:e.fullName})})]},"multi-"+t)})),h&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return v(!1)},children:(0,r.jsx)(x,{})}),j&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return g(!1)},children:(0,r.jsx)(N,{})}),y&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return S(!1)},children:(0,r.jsx)(w,{})})]})},C=n(8646),O=n(5301),I=n(4713);function T(e,t,n,r,a,s,i){try{var l=e[s](i),c=l.value}catch(o){return void n(o)}l.done?t(c):Promise.resolve(c).then(r,a)}var E=function(e){var t=e.data,n=e.handleParentSync,a=(0,l.useState)(),s=a[0],c=a[1],o=(0,l.useState)(),u=o[0],d=o[1],m=(0,l.useState)(),h=m[0],v=m[1],p=(0,l.useState)(),j=p[0],g=p[1];(0,l.useEffect)((function(){!s&&t&&c(t)}));var b=function(){var e,t=(e=i().mark((function e(t){var r,a,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/update-field",{body:JSON.stringify({fullName:s.fullName,value:t.target.value,contactId:s.contactId}),headers:{"Content-Type":"application/json"},method:"POST"});case 3:return r=e.sent,e.next=6,r.json();case 6:a=e.sent,l=a.error,g(!1),n(!1),l?v(!0):(d(!0),setTimeout((function(){d(!1)}),2e3)),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(0),console.log(e.t0),n(!1),v(!0);case 18:case"end":return e.stop()}}),e,null,[[0,13]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var s=e.apply(t,n);function i(e){T(s,r,a,i,l,"next",e)}function l(e){T(s,r,a,i,l,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}(),y=(0,l.useMemo)((function(){return f()(b,3e3)}),[s]);return(0,r.jsx)(r.Fragment,{children:s&&(0,r.jsxs)("div",{children:["TextArea"===s.type&&(0,r.jsx)("textarea",{onChange:function(e){g(!0),n(!0),y(e)},maxlength:"255",rows:4,name:"comment",id:"comment",className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md",defaultValue:t.value}),"Text"===s.type&&(0,r.jsx)("input",{onChange:function(e){g(!0),n(!0),y(e)},type:"lname",name:"lname",maxlength:"50",id:"lname",className:"focus:ring-[#30BCED] focus:border-[#30BCED] block w-full pl-4 sm:text-sm border-gray-300 rounded-md py-1 h-10 text-black",defaultValue:t.value}),u&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return d(!1)},children:(0,r.jsx)(x,{})}),h&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return v(!1)},children:(0,r.jsx)(N,{})}),j&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return g(!1)},children:(0,r.jsx)(w,{})})]})})};function D(e,t,n,r,a,s,i){try{var l=e[s](i),c=l.value}catch(o){return void n(o)}l.done?t(c):Promise.resolve(c).then(r,a)}var F=function(e){var t,n=e.contactId,a=e.defaultImage,s=e.updateImageCallback,c=e.imageState,o=(0,l.useState)(),u=o[0],d=o[1],m=(0,l.useState)(),f=m[0],x=m[1],h=(0,l.useState)(1),v=h[0],p=h[1],j=(0,l.useState)(),g=j[0],b=j[1];return(0,l.useEffect)((t=i().mark((function e(){var t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f&&v===c){e.next=19;break}return console.log("render"),e.prev=2,e.next=5,fetch("/api/get-image?"+new URLSearchParams({contactId:n}));case 5:return t=e.sent,b(a),p(c),e.next=10,t.json();case 10:r=e.sent,s(r.imgId),x(r.image),d(r.contentType),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(2),console.log("errorrrrr");case 19:case"end":return e.stop()}}),e,null,[[2,16]])})),function(){var e=this,n=arguments;return new Promise((function(r,a){var s=t.apply(e,n);function i(e){D(s,r,a,i,l,"next",e)}function l(e){D(s,r,a,i,l,"throw",e)}i(void 0)}))})),(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("label",{className:"uppercase text-sm",children:"photo"}),(0,r.jsx)("img",{className:"max-w-14 max-h-14 w-14 h-14 border-2 border-[#30BCED] rounded-full",src:f?"data:"+u+";base64,"+f:g})]})})},_=n(9669),Z=n.n(_),A=function(e){var t=e.contactId,n=e.imageId,a=e.imageStateCallback,s=(0,l.useState)(),i=s[0],c=s[1],o=(0,l.useState)(),u=o[0],d=o[1],m=(0,l.useState)(),f=m[0],h=m[1],v=(0,l.useState)(),p=v[0],j=v[1],g=(0,l.useState)(),y=g[0],S=g[1],k=(0,l.useState)(),P=k[0],C=k[1],O=(0,l.useState)(),I=(O[0],O[1],(0,l.useState)()),T=I[0],E=I[1],D=(0,l.useRef)(),F=function(){D.current.value=""};return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"",children:(0,r.jsxs)("div",{className:"flex flex-col justify-around",children:[(0,r.jsxs)("div",{className:"",children:[(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"PNG, JPG, or SVG up to 4MB"}),(0,r.jsx)("input",{ref:D,required:!0,type:"file",className:"form-control text-xs ",htmlFor:"file-upload",name:"upload_file",onChange:function(e){var t=e.target.files;if(console.log(t),t[0].size>4e6)return E("Max image size is 4MB. Please choose a smaller image."),void(D.current.value="");E(""),d(t[0].name),h(t[0].type);var n=new FileReader;n.readAsDataURL(t[0]),n.onload=function(e){c(e.target.result)}}})]}),T&&(0,r.jsx)("div",{className:"rounded-md bg-red-50 p-2 mt-2",children:(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(b.Z,{className:"h-5 w-5 text-red-400","aria-hidden":"true"})}),(0,r.jsx)("div",{className:"ml-3",children:(0,r.jsx)("p",{className:"text-sm font-medium text-red-800",children:T})})]})}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)("button",{type:"submit",className:"clickable inline-flex z-50 pointer-events-auto items-center px-2.5 py-1.5 border border-transparent text-xs font-medium rounded text-black bg-white hover:bg-indigo-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",onClick:function(){return function(){if(D.current.value){j(!0);var e={image:i,contactId:t,fileName:u,fileType:f,imageId:n};Z().post("/api/profile-image",e,{}).then((function(e){a(),F(),j(!1),S(!0),setTimeout((function(){S(!1)}),2e3),console.warn(e.data)})).catch((function(e){j(!1),C(!0),setTimeout((function(){C(!1)}),2e3)}))}}()},children:"Submit"})})]})}),y&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return S(!1)},children:(0,r.jsx)(x,{})}),p&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return j(!1)},children:(0,r.jsx)(w,{})}),P&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return C(!1)},children:(0,r.jsx)(N,{})})]})},z=function(e){var t=e.data,n=(e.handleParentSync,(0,l.useState)("")),a=n[0],s=n[1],i=(0,l.useState)(),c=(i[0],i[1]),o=(0,l.useState)(""),u=o[0],d=(o[1],(0,l.useState)()),m=(d[0],d[1],(0,l.useState)()),f=m[0],h=(m[1],(0,l.useState)()),v=h[0],p=h[1];return(0,l.useEffect)((function(){if(!a&&t&&!u){var e=t["https://claims.complexityweekend.com/"+"username"];s(e),c(t.sub)}})),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"uppercase text-sm",children:"username"}),(0,r.jsxs)("div",{className:"mt-1 relative rounded-md shadow-sm",children:[(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,r.jsx)("img",{alt:"User Icon",src:"/user.svg",className:"h-5 w-5 text-gray-400","aria-hidden":"true"})}),(0,r.jsx)("input",{value:a,type:"lname",name:"lname",id:"lname",className:"focus:ring-[#30BCED] focus:border-[#30BCED] block w-full pl-10 lowercase sm:text-sm border-gray-300 rounded-md py-1 h-10 text-black",placeholder:"Last Name"})]}),f&&(0,r.jsx)("div",{className:"rounded-md bg-red-50 p-2 ml-8 mt-2",children:(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(b.Z,{className:"h-5 w-5 text-red-400","aria-hidden":"true"})}),(0,r.jsx)("div",{className:"ml-3",children:(0,r.jsx)("p",{className:"text-sm font-medium text-red-800",children:f})})]})}),v&&(0,r.jsx)("div",{className:"bottom-0 right-0 fixed z-50",onClick:function(){return p(!1)},children:(0,r.jsx)(x,{})})]})};function B(e){var t=e.text;return(0,r.jsx)("div",{className:"relative bg-red-700",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto py-3 px-3 sm:px-6 lg:px-8",children:(0,r.jsx)("div",{className:"pr-16 sm:text-center sm:px-16",children:(0,r.jsx)("p",{className:"font-medium text-red-50",children:(0,r.jsx)("span",{className:"block sm:ml-2 sm:inline-block",children:t})})})})})}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n